package xiangmu;

public class JiaoChe extends Car {
    private String xinghao;

    public String getXinghao() {
        return xinghao;
    }

    public JiaoChe setXinghao(String xinghao) {
        this.xinghao = xinghao;
        return this;
    }

    public JiaoChe() {
    }

    public JiaoChe(String chepai, String pinpai, double rizujin, String xinghao) {
        super(chepai, pinpai, rizujin);
        this.xinghao = xinghao;
    }

    public double jisuan(int day) {
        if (day>=7){
            return getRizujin()*day*0.9;
        } if (day>=30){
            return getRizujin()*day*0.8;
        } if (day>=150){
            return getRizujin()*day*0.7;
        }
        return getRizujin()*day;
    }

    public void show() {
        System.out.print("车类型为轿车，车牌号为"+getChepai()+"。日租金为："+getRizujin()+"，品牌为"+getPinpai()+"，型号为"+getXinghao()+"。"+"当前状态为："+((getChuzuzhuangtai()==1)?"可出租":"已经出租"));
        System.out.println();
    }
}
